#include <bits/stdc++.h>
using namespace std;
int main(){
    int t,n;
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    cin>>t;
    while(t--){
        cin>>n;
        vector<string> v(n);
        vector<int[6]> a(n);
        for(int i=0;i<n;i++){
            cin>>v[i];
            for(int j=0;j<v[i].size();j++){
                a[i][v[i][j]-'a']++;
            }
            a[i][5]=v[i].size();
        }
        for(int i=0;i<5;i++){
            vector<int[2]> dp(n);
            vector<int[2]> dp2(n);
            for(int j=0;j<n;j++){
                if(j&&dp[j-1]){
                    if(dp[j-1]+)
                }else{
                    if(a[j][i]>a[j][5]/2){
                        dp[j]=a[j][i]-a[j][5]/2;
                        dp2[j]=1;
                    }
                }
            }
        }
    }
    return 0;
}